import jwt from 'jsonwebtoken';
import { config } from '../config';
import { IDevice } from '../models/device';

export const generateDeviceToken = (device: IDevice): string => {
  return jwt.sign(
    { deviceId: device.deviceId },
    config.jwtSecret,
    { expiresIn: '365d' } // 设备token长期有效
  );
}; 